﻿@model Aurora.WebApp.ViewModel.Branch.ListSucursalesViewModel
@{
    ViewBag.Title = "Sucursales";
}

<div class="panel-group" id="accordion-example">
    <div class="panel">
        <div class="panel-heading">
            <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion-example" href="#collapseOne">
                <i class="fa fa-filter"></i> &nbsp;&nbsp;Filtro
            </a>
           
        </div>
        <div id="collapseOne" class="panel-collapse collapse" style="height: 0px;">
            <div class="panel-body">
                <form method="post" class="form-horizontal">
                    <div class="row">
                        <div class="col-sm-4">
                            <div class="form-group no-margin-hr">
                                <label class="control-label">Responsable</label>
                                @Html.TextBoxFor(x => x.SUC_CONTACTO, new { @class="form-control" })
                            </div>
                        </div><!-- col-sm-6 -->
                        <div class="col-sm-8">
                            <div class="form-group no-margin-hr">
                                <label class="control-label">Dirección</label>
                                @Html.TextBoxFor(x => x.SUC_DIRECCION, new { @class="form-control" })
                            </div>
                        </div><!-- col-sm-6 -->
                    </div><!-- row -->
                    <div class="panel-footer text-right">
                        <button class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;&nbsp;Buscar</button>
                    </div>
                </form>
            </div>

        </div>
    </div>
</div>
<div class="clear-fix"></div>
<div class="table-primary">
    <div class="table-header">
        <div class="table-caption">
           <i class="fa fa-list"></i>&nbsp;&nbsp;Resultados
            <div class="pull-right">
                <a href="@Url.Action("AddEditSucursal", "Branch")" class="btn btn-sm btn-default"><i class="fa fa-plus"></i>&nbsp;&nbsp;Agregar Sucursal</a>
            </div>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th class="col-sm-2 text-center">Responsable</th>
                <th class="col-sm-1 text-center">Telefono</th>
                <th class="col-sm-2 text-center">Cliente</th>
                <th class="col-sm-2 text-center">Dirección</th>
                <th class="col-sm-3 text-center">Observaciones</th>
                <th class="col-sm-2 text-center">Opciones</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.LstSucursales)
            {
                <tr>
                    <td>@item.SUC_CONTACTO</td>
                    <td class="text-center">@item.SUC_TELEFONO</td>
                    <td>@item.Cliente.CLI_NOMBRE</td>
                    <td>@item.SUC_DIRECCION</td>
                    <td>@item.SUC_OBSERVACIONES</td>
                    <td class="text-center">
                        <a href="@Url.Action("AddEditSucursal", "Branch", new { SUC_ID = item.SUC_ID })" class="btn btn-sm btn-info"><i class="fa fa-pencil"></i>&nbsp;&nbsp;Editar</a>&nbsp;
                        <a @Data.ModalLink("ConfirmDeleteSucursal", "Branch", new { SUC_ID = item.SUC_ID }) class="btn btn-sm btn-danger"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;Eliminar</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
@Html.PagedListPager(Model.LstSucursales, page => Url.Action("LstSucursalesAll", new { np = page , SUC_CONTACTO = Model.SUC_CONTACTO ,  SUC_DIRECCION = Model.SUC_DIRECCION }), ConstantHelpers.Bootstrap3Pager)

